<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <cpn2></cpn2>
    </div>
</body>
<script src='../js/vue.js'></script>
<script>
    // 子组件
    const cpnC1 = Vue.extend({
        template:`
            <div>
                <h2>
                    我是子组件    
                </h2>   
            </div>
        `
        
    })
    // 父组件
    const cpnC2 = Vue.extend({
        template:`
            <div>
                <h2>
                    我是父组件    
                </h2>
                <cpn1></cpn1>    
            </div>
        `,
        components: {
            cpn1:cpnC1,
        }
    })

    let app = new Vue({
        el: '#app',
        data: {
             msg:'hello vue.js'
        },
        methods: {},
        components: {
            cpn2:cpnC2
        }
    })
</script>
</html>